﻿using System.Collections.Generic;
using ZilLion.Service.Core.DapperWrapper;
using ZilLion.Service.WechatService.Domain.WebApiEntity.CRM;
using ZilLion.Service.WechatService.Domain.WebApiRepository.InterFace;

namespace ZilLion.Service.WechatService.Domain.WebApiRepository
{
    public class GongxparamsshengxRepository : Respository<GongxparamItem>, IGongxparamsshengxRepository
    {
        public GongxparamsshengxRepository() : base(new WechatServiceContext())
        {
        }

        public IEnumerable<GongxparamItem> GetGongxparamsshengx()
        {
            IEnumerable<GongxparamItem> gongxparamItems = this.GetList("select * from gongxparamsshengx");
            return gongxparamItems;
        }

        public void InsertGongxparamItem(GongxparamItem item)
        {
            this.Add(item);
        }

        public void UpdateGongxparamItem(GongxparamItem item)
        {
            this.Modify(item);
            //this.Execute("update gongxparamsshengx set shxvalue=@shxvalue where shxkey=@shxkey ", new { shxkey });
        }

        public void DeleteAppidjoininfo(GongxparamItem item)
        {
            //item.jisforbid = 1;
            //this.Execute("update xtwxappidjoininfo set jisforbid=1  where jappid=@jappid and jkey=@jkey", new { item.jvalue, item.jappid, item.jkey });
            this.Remove(item);
        }
    }
}
